package com.c2soft.nepalcmx.dao;

import java.util.List;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import com.c2soft.nepalcmx.command.BrokeUserCommand;


public class BrokeUserDAO {
	
	@Autowired
	private DataSource dataSource;

	private JdbcTemplate jdbcTemplate;

	public List<BrokeUserCommand> findUserList(String brokerId) {
		String sql = "select user_id from brokers where BROKER_ID= ? and user_id!=''";
		jdbcTemplate = new JdbcTemplate(dataSource);
		List<BrokeUserCommand> userList=jdbcTemplate.query(sql,new Object[]{brokerId},new BeanPropertyRowMapper(BrokeUserCommand.class));
		return userList;

	}

}
